const commonAttr = {
  xAxisColor: 'rgba(36, 126, 255, 0.6)',
  ySplitLineColor: 'rgba(36, 126, 255, 0.2)',

  // 暂无数据的 option
  notDataOption: {
    title: {
      text: '暂无数据',
      left: 'center',
      top: 'middle',
      textStyle: {
        fontSize: 16,
        color: '#C6CBDE'
      }
    }
  }
}

const chartsTheme = {
  dark: () => {
    commonAttr.notDataOption.title.textStyle.color = '#C6CBDE'

    return {
      ...commonAttr,
      color: '#C6CBDE',
      richColor: 'rgba(198, 203, 222, 0.8)',
      tooltipBg: '#222E45',

      bg: '#1C202C',
    }
  },

  white: () => {
    commonAttr.notDataOption.title.textStyle.color = '#0B0E20'

    return {
      ...commonAttr,
      color: '#0B0E20',
      richColor: 'rgba(11, 14, 32, 0.8)',
      tooltipBg: '#EBF2FE',

      bg: '#fff',
    }
  },
}

// 控制主题的开关
const curTheme = chartsTheme.white()

export { curTheme }
